{include file="public/_header" /}
<div class="x-body">
    <form class="layui-form" method="post" enctype="multipart/form-data" action="/admin/message/update">

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>省份
            </label>
            <div class="layui-input-inline">
                <input type="text" name="province_name" required="" lay-verify="required"
                       autocomplete="off" class="layui-input" value="{$find_data.province_name}" disabled>
            </div>
        </div>


        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>城市
            </label>
            <div class="layui-input-inline">
                <input type="text" name="city_name" required="" lay-verify="required"
                       autocomplete="off" class="layui-input" value="{$find_data.city_name}" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>客户姓名
            </label>
            <div class="layui-input-inline">
                <input type="text" name="name" required="" lay-verify="required"
                       autocomplete="off" class="layui-input"  value="{$find_data.name}" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>所属行业
            </label>
            <div class="layui-input-inline">
                <input type="text" name="trade_name" required="" lay-verify="required"
                       autocomplete="off" class="layui-input"  value="{$find_data.trade_name}" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <label  class="layui-form-label">
                <span class="x-red">*</span>时间
            </label>
            <div class="layui-input-inline">
                <input type="text" name="create_time" required="" lay-verify="required"
                       autocomplete="off" class="layui-input"  value="{$find_data.create_time|date="Y/m/d",###}" disabled>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">客户留言</label>
            <div class="layui-input-block">
                <textarea name="note" placeholder="请输入内容" class="layui-textarea">{$find_data.content}</textarea>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">客户备注</label>
            <div class="layui-input-block">
                <textarea name="note" placeholder="请输入内容" class="layui-textarea">{$find_data.note}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">显示设置</label>
            <div class="layui-input-block">
                <input type="radio" name="type" title="意向客户"    {if	 condition="$find_data.type==2"} checked="checked"  {/if} >
                <input type="radio" name="type"  title="已处理" {if	 condition="$find_data.type==3"} checked="checked"  {/if} >
            </div>
        </div>

        <input type="hidden" name="id" value="{$find_data.id}">

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="*">立即提交</button>
            </div>
        </div>


    </form>
</div>

<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
                , layer = layui.layer;

        //自定义验证规则
        form.verify({
            nikename: function (value) {
                if (value.length < 5) {
                    return '昵称至少得5个字符啊';
                }
            }
            , pass: [/(.+){6,12}$/, '密码必须6到12位']
            , repass: function (value) {
                if ($('#L_pass').val() != $('#L_repass').val()) {
                    return '两次密码不一致';
                }
            }
        });

        //监听提交
        form.on('submit(add)', function (data) {
            console.log(data);
            //发异步，把数据提交给php
            layer.alert("增加成功", {icon: 6}, function () {
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            });
            return false;
        });


    });

    layui.use('laydate', function () {
        $ = layui.jquery;
        var laydate = layui.laydate;
        //日期时间范围
        laydate.render({
            elem: '#test10'
            , type: 'datetime'
            , range: true
        });
    });




</script>